GATE CSE 2008
Q21.
Which combination of the integer variables x, y and z makes the variable a get the value 4 in the following expression? a = (x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z)Q23.
Which of the following statements are true? I. Every left-recursive grammar can be converted to a right-recursive grammar and vice-versa II. All \varepsilon-productions can be removed from any context-free grammar by suitable transformations III. The language generated by a context-free grammar all of whose productions are of the form x \rightarrow w or x \rightarrow wY (where, w is a string of terminals and Y is a non-terminal), is always regular IV. The derivation trees of strings generated by a context-free grammar in Chomsky Normal Form are always binary treesQ24.
Which of the following is NOT true of deadlock prevention and deadlock avoidance schemes?Q25.
The subset-sum problem is defined as follows. Given a set of n positive integers, S={a_{1},a_{2},...,a_{n}} and positive integer W, is there a subset of S whose elements sum to W? A dynamic program for solving this problem uses a 2-dimensional Boolean array, X, with n rows and W+1 columns. X[i,j], 1\leq i\leq n, 0\leq j \leq W, is TRUE if and only if there is a subset of {a_{1},a_{2},...,a_{i} }whose elements sum to j. Which of the following is valid for 2\leq i\leq n and a_{i} \leq j \leq W?Q26.
The subset-sum problem is defined as follows. Given a set of n positive integers, S={a_{1},a_{2},...,a_{n}} and positive integer W, is there a subset of S whose elements sum to W? A dynamic program for solving this problem uses a 2-dimensional Boolean array, X, with n rows and W+1 columns. X[i,j], 1\leq i\leq n, 0\leq j \leq W, is TRUE if and only if there is a subset of {a_{1},a_{2},...,a_{i} }whose elements sum to j. Which entry of the array X, if TRUE, implies that there is a subset whose elements sum to W?Q28.
Consider the following ER diagram Which of the following is a correct attribute set for one of the tables for the minimum number of tables needed to represent M, N, P, R1, R2?Q29.
Consider the following ER diagram The minimum number of tables needed to represent M, N, P, R1, R2 isQ30.
The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the nodes of the following graph is